<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">

<head>
  <title></title>
  <meta charset="utf-8">
  <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  <link rel="stylesheet" href="css/fonts/font-awesome.min.css">
  <link rel="stylesheet" href="css/ui-box.css">
  <link rel="stylesheet" href="css/ui-base.css">
  <link rel="stylesheet" href="css/ui-color.css">
  <link rel="stylesheet" href="css/appcan.icon.css">
  <link rel="stylesheet" href="css/appcan.control.css">
  <link rel="stylesheet" href="css/BaggageTrace.css?v=123">
  <link rel="stylesheet" href="css/base.css">
</head>

<body class="um-vp bcF8F8F8 pre" ontouchstart>
    <img src="images/bg.png" style="display:none;" />    
    <canvas id = "watermark" width = "200px"  height = "100px" style="display:none;"></canvas>
    <canvas id = "repeat-watermark"></canvas>
  <main id="BaggageFlightQueryMain" class="">
    <section class="ub ub-ver ml10 fs9">
      <div class="ub ub-ac bor_bot2_D7D7D7">
        <div class="select bor-borderBABABA fs9">
          <div id="ac" class="pl5 pr5 w20">
            MU
          </div>
          <div class="icon"></div>
          <select id="select" selectedindex="0">
                 <option value="MU">MU</option>
                 <option value="FM">FM</option>
                 <option value="KN">KN</option>
               </select>
        </div>

        <input id="flightNo" class="ub-f1 pl10 lh30 bor_none bcF8F8F8 fs10 db ub-f1" type="text" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" placeholder="请输入航班号" maxlength="6">
      </div>
      <div class="ub bor_bot2_D7D7D7">
        <p class="wsp lh30 c9B9B9B">选择日期 :</p>
        <div id="selectDate" class="ub-f1 pl10 h_inherit lh30"></div>
      </div>
    </section>
  </main>

  <button style="position:absolute;bottom:0" id="BaggageFlightQueryBtn" class="bc3BBBD7 bor_none wtp100 cfff lh25 fs10 tx-c">
    查询
  </button>


</body>
<script src="js/appcan.js"></script>
<script src="js/appcan.control.js"></script>
<script src="js/jquery-3.1.1.min.js"></script>
<script src="js/z_API.js"></script>
<script src="js/talkingdata.js"></script>
<script>
  appcan.ready(function() {
    var http = appcan.locStorage.getVal("baggageHttp");
    var url = http + "zyh_queryFlightBaggage";
iG.bgm();
    //设置日期

    var flightDate = getNowDate();
    $("#selectDate").html(flightDate);
    $("#selectDate").click(function() {
      pickerDate("#selectDate", function(date) {
        flightDate = date;
      });
    });

    appcan.select(".select", function(ele, value) {
      $("#ac").html(value);
    });

    /*
     *  查询按钮点击方法
     *
     */
    $("#BaggageFlightQueryBtn").click(function() {
        
      IC.talkingDataCount("行李服务","16");
     
      //获取航站
      var mySelect = $.trim($("#ac").text());
      //获取航班号
      var flightNo = $("#flightNo").val();

      if (!flightNo) {
        alerts("请输入航班号");
        return false;
      } else {
        flightNo = mySelect + flightNo;
      }
      if (!flightDate || flightDate === "请选择日期") {
        alerts("请选择日期");
        return false;
      }
      
      var remark = "航班号:" + flightNo + ",航班日期:"+flightDate + ",操作时间:" + getNowDateHourMinutes();
      operatingRecord(userName,"航班查询",remark);

      //高端行李请求参数
      appcan.locStorage.setVal("flightNo",flightNo);
      appcan.locStorage.setVal("flightDate",flightDate);

      var param = {
        flightNo: flightNo,
        flightDate: flightDate,
        token: token
      };

      var res = AJAXRequestData({
        url: url,
        type: "POST",
        data: param
      }, function(res) {
        //保存航班列表
        appcan.locStorage.setVal("flightListBaggage", res);
        appcan.window.open({
          name: "BaggageFlightListPage",
          dataType: 0,
          aniId: 5,
          data: "BaggageFlightListPage.html",

        });
      });

    });

  });
</script>

</html>
